We no longer get stuck when a background manager is destroyed during
the startup animation, but we now resolve before the new backgrounds
have been loaded.
Address this by keeping the returned promise around until it is fulfilled,
and only resolve it after backgrounds were loaded successfully.
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/4070>
return promise;
}
- _updateBackgrounds() {
+ async _updateBackgrounds() {
this._bgLoadCancellable?.cancel();
this._bgLoadCancellable = null;
bgManager.backgroundActor.hide();
}
- return Promise.all(
- this._bgManagers.map(mgr => this._waitLoaded(mgr, cancellable)));
+ if (!this._updateBackgroundsResolvers)
+ this._updateBackgroundsResolvers = Promise.withResolvers();
+
+ const {promise, resolve} = this._updateBackgroundsResolvers;
+ try {
+ await Promise.all(
+ this._bgManagers.map(mgr => this._waitLoaded(mgr, cancellable)));
+
+ delete this._updateBackgroundsResolvers;
+ resolve();
+ } catch {}
+
+ return promise;
}
_updateKeyboardBox() {